<?php

class CIllegalArgumentException extends Exception {
	private $Value;

	public function value() {
		return $this->Value;
	}

	protected function setValue($newValue) {
		$this->Value = $newValue;
		return $this;
	}
	
	private $ArgumentName;

	public function argumentName() {
		return $this->ArgumentName;
	}

	protected function setArgumentName($newValue) {
		$this->ArgumentName = $newValue;
		return $this;
	}

	private $Reason;

	public function reason() {
		return $this->Reason;
	}

	protected function setReason($newValue) {
		$this->Reason = $newValue;
		return $this;
	}
	
	function __construct($value = null, $argumentName = null, $reason = null, $message = null) {
		CDefault($reason, "[see documentation]");
		if ($value && $argumentName)
			CDefault($message, "$value is not allowed for argument $argumentName: $reason.");
		parent::__construct((string) $message);
	}
}

?>